<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <meta name="author" content="">

  <title>发布服务</title>

  <!-- Custom fonts for this template-->
  <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">
  <link href="css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
  <!-- Custom styles for this template-->
  <link href="css/sb-admin-2.min.css" rel="stylesheet">

</head>

<body id="page-top">

  <!-- Page Wrapper -->
  <div id="wrapper">



    <!-- Content Wrapper -->
    <div id="content-wrapper" class="d-flex flex-column">

      <!-- Main Content -->
      <div id="content">

          <!-- Topbar -->
          <nav class="navbar navbar-expand navbar-light bg-gradient-primary topbar mb-4 static-top shadow">


              <!-- Nav Item - Dashboard -->
              <a class="nav-link" href="service_list.html">
                  <span style="width:70px;display:-moz-inline-box; display:inline-block;color: white;font-weight: bold;">首页</span>
              </a>

              <a class="nav-link" href="service_list.html">
                  <span style="width:80px;display:-moz-inline-box; display:inline-block;color: white;font-weight: bold;">接取服务</span>
              </a>

              <a class="nav-link" href="donate.html">
                  <span style="width:80px;display:-moz-inline-box; display:inline-block;color: white;font-weight: bold;">赠送志愿时</span>
              </a>

              <a class="nav-link" href="crowdfunding.html">
                  <span style="width:80px;display:-moz-inline-box; display:inline-block;color: white;font-weight: bold;">公益众筹</span>
              </a>
              <a class="nav-link" href="buy.html">
                  <span style="width:80px;display:-moz-inline-box; display:inline-block;color: white;font-weight: bold;">志愿时商城</span>
              </a>

              <a class="nav-link" href="new-service.html">
                  <span style="width:80px;display:-moz-inline-box; display:inline-block;color: white;font-weight: bold;">发布服务</span>
              </a>

              <a class="nav-link" href="user.html">
                  <span style="width:80px;display:-moz-inline-box; display:inline-block;color: white;font-weight: bold;">用户中心</span></a>

              <!-- Topbar Search -->
              <form class="d-none d-sm-inline-block form-inline mr-auto ml-md-3 my-2 my-md-0 mw-100 navbar-search">

                  <div class="input-group" style="float: left">
                      <input type="text" class="form-control bg-light border-0 small" placeholder="请输入要搜索的服务" aria-label="Search" aria-describedby="basic-addon2">
                      <div class="input-group-append" style="z-index: 0">
                          <button class="btn btn-danger" type="button">
                              <i class="fas fa-search fa-sm"></i>
                          </button>
                      </div>
                  </div>
              </form>

              <!-- Topbar Navbar -->
              <ul class="navbar-nav ml-auto">

                  <!-- Nav Item - Search Dropdown (Visible Only XS) -->
                  <li class="nav-item dropdown no-arrow d-sm-none">
                      <a class="nav-link dropdown-toggle" href="#" id="searchDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                          <i class="fas fa-search fa-fw"></i>
                      </a>
                      <!-- Dropdown - Messages -->
                      <div class="dropdown-menu dropdown-menu-right p-3 shadow animated--grow-in" aria-labelledby="searchDropdown">
                          <form class="form-inline mr-auto w-100 navbar-search">
                              <div class="input-group">
                                  <input type="text" class="form-control bg-light border-0 small" placeholder="请输入要搜索的服务" aria-label="Search" aria-describedby="basic-addon2">
                                  <button class="btn btn-primary" type="button">
                                      <i class="fas fa-search fa-sm"></i>
                                  </button>
                                  <!--                     <div class="input-group-append">

                                                      </div> -->
                              </div>
                          </form>
                      </div>
                  </li>



                  <div class="topbar-divider d-none d-sm-block"></div>

                  <!-- Nav Item - User Information -->
                  <li class="nav-item dropdown no-arrow">
                      <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                          <span class="mr-2 d-none d-lg-inline text-light small">唐焌景</span>
                          <img class="img-profile rounded-circle" src="https://source.unsplash.com/QAB-WJcbgJk/60x60">
                      </a>
                      <!-- Dropdown - User Information -->
                      <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in" aria-labelledby="userDropdown">
                          <a class="dropdown-item" href="#">
                              <i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i>
                              Profile
                          </a>
                          <a class="dropdown-item" href="#">
                              <i class="fas fa-cogs fa-sm fa-fw mr-2 text-gray-400"></i>
                              Settings
                          </a>
                          <a class="dropdown-item" href="#">
                              <i class="fas fa-list fa-sm fa-fw mr-2 text-gray-400"></i>
                              Activity Log
                          </a>
                          <div class="dropdown-divider"></div>
                          <a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">
                              <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
                              Logout
                          </a>
                      </div>
                  </li>

              </ul>

          </nav>
          <!-- End of Topbar -->

        <!-- Begin Page Content -->
        <div class="container-fluid">
            <div class="map" th:onclick="|javascript:fungetone()|">
                <iframe width="100%" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.co.in/maps?f=q&amp;source=s_q&amp;hl=zh-cn&amp;geocode=&amp;q=华师社区卫生服务中心,+广州,中国+广东&amp;aq=4&amp;oq=light&amp;sll=23.139529, 113.355244&amp;sspn=0.04941,0.104628&amp;ie=UTF8&amp;hq=&amp;hnear=华师社区卫生服务中心,+广州,中国+广东&amp;t=m&amp;z=14&amp;ll=23.139529, 113.355244&amp;output=embed"></iframe><br><small><a href="https://maps.google.co.in/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=华师社区卫生服务中心,+广州,中国+广东&amp;aq=4&amp;oq=light&amp;sll=23.139529, 113.3552444&amp;sspn=0.04941,0.104628&amp;ie=UTF8&amp;hq=&amp;hnear=华师社区卫生服务中心,+广州,中国+广东&amp;t=m&amp;z=14&amp;ll=23.139529, 113.355244" style="color:#666;text-align:left;font-size:12px"></a></small>
            </div>
          <br>
            <script>
                // Example starter JavaScript for disabling form submissions if there are invalid fields
                function fungetone(){
                    document.getElementById( "wait").value="华师社区卫生服务中心";
                    var type=document.getElementById("serviceType").value;
                    if(type=="居家陪伴") document.getElementById("price").value = 3+" h";
                    if(type=="陪同出行")  document.getElementById("price").value=4+" h";
                    if(type=="卫生打扫")  document.getElementById("price").value=4.5+" h";
                    if(type=="上门护理") document.getElementById("price").value=6+" h";
                    if(type=="心理疏导") document.getElementById("price").value=5.5+" h";
                    if(type=="西部支教") document.getElementById("price").value=1000+" h";
                }
                function selectService(){
                    if(document.getElementById( "wait").value=="华师社区卫生服务中心"){
                    var type=document.getElementById("serviceType").value;
                    if(type=="居家陪伴") document.getElementById("price").value = 3+" h";
                    if(type=="陪同出行")  document.getElementById("price").value=4+" h";
                    if(type=="卫生打扫")  document.getElementById("price").value=4.5+" h";
                    if(type=="上门护理") document.getElementById("price").value=6+" h";
                    if(type=="心理疏导") document.getElementById("price").value=5.5+" h";
                    if(type=="西部支教") document.getElementById("price").value=1000+" h";
                    }

                }
            </script>
          <!--表单-->
          <div class="card">
  				<div class="card-body">
          <form class="needs-validation" novalidate th:action="@{publish_detail}">
				  <div class="form-row">
				  	<div class="col-md-3 mb-3">
				      <label for="validationCustom01"><img src="img/name.svg" class="" width="26px" height="26px">接受服务人姓名</label>
				      <input type="text" class="form-control" id="validationCustom01" value="" name="ownerName">
			      	<div class="invalid-feedback">
				        	接受服务人姓名不能为空
				      </div>
			      </div>
                      <div class="col-md-3 mb-3">
                          <label th:onclick="|javascript:fungetone()|" style="text-decoration:underline;color:#d52a1a" for="validationCustom02"><img src="img/address.png" class="" width="26px" height="26px">定位</label>
                          <input id="wait" type="text" class="form-control" value="详细地址">
                          <div class="invalid-feedback">
                              详细地址
                          </div>
                      </div>
				    <div class="col-md-3 mb-3">
				      <label for="validationCustom02"><img src="img/service_type.svg" class="" width="26px" height="26px">服务类型</label>
				      <select class="custom-select form-control" value="0" id="serviceType" required th:onchange="|javascript:selectService()|" name="type">
				        <option value="居家陪伴">居家陪伴</option>
                          <option value="陪同出行">陪同出行</option>
				        <option value="卫生打扫">卫生打扫</option>
                          <option value="上门护理">上门护理</option>
                          <option value="心理疏导">心理疏导</option>
                          <option value="西部支教">西部支教</option>
				        <option>...</option>
				      </select>
				      <div class="invalid-feedback">
				        	请选择服务类型
				      </div>
				    </div>
                      <div class="col-md-3 mb-3">
                          <label for="validationCustom02"><img src="img/time.png" class="" width="26px" height="26px">服务时间</label>
                      <div class="input-group date form_datetime" data-date="2020-09-16T05:25:07Z" data-date-format="yyyy-MM-dd HH:ii:p" data-link-field="dtp_input1">
                          <input class="form-control" type="text" value="" readonly name="description">
                          <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                      </div>
                      <input type="hidden" id="dtp_input1" value="" /><br/>
                      </div>
				  </div>
          <br>
          <div class="mb-3">
				    <textarea class="form-control" id="validationTextarea" rows="7" placeholder="请描述服务的具体内容" name="title"></textarea><br>
				    <!--<div class="invalid-feedback">
				      Please enter a message in the textarea.
				    </div>-->
				  </div>
				  
				  <div class="form-row">
				  	<div class="col-md-3 mb-3">
				      <label><img src="img/coins.svg" class="" width="26px" height="26px">预计所需志愿时</label>
				      <input type="text" class="form-control" id="price" value="0" disabled="disabled">
			      </div>
			      <div class="col-md-3 mb-3">
				      <label><img src="img/coins.svg" class="" width="26px" height="26px">实际发布志愿时</label>
				      <input type="text" class="form-control" value="" required name="price">
			      	<div class="invalid-feedback">
				        	至少为0，不能为空
				      </div>
			      </div>
                      <div class="col-md-3 mb-3">
                          <blockquote class="blockquote mb-0 text-center">
                              <label><img src="img/coins.svg" class="" width="26px" height="26px">可用志愿时</label>
                              <p><img src="img/coins.svg" class="" width="30px" height="30px" th:text="${balance2}+'  h'"></p>
                              <!--<footer class="blockquote-footer">Someone famous in <cite title="Source Title">Source Title</cite></footer>-->
                          </blockquote>
                      </div>
				  </div>

				  <div class="form-row">
				    <div class="col-md-3 mb-3">
				      <label for="validationCustom04"><img src="img/pw.svg" class="" width="22px" height="22px">密码</label>
				      <input type="password" class="form-control" id="validationCustom04" value="" required>
			      	<div class="invalid-feedback">
				        	密码错误
				      </div>
			      </div>
				  </div>
				  <div class="form-group">
				    <div class="form-check">
				      <input class="form-check-input" type="checkbox" value="" id="invalidCheck" required>
				      <label class="form-check-label" for="invalidCheck">
				        	我已阅读并同意《时间银行》条款
				      </label>
				      <div class="invalid-feedback">
				        	请先仔细阅读并选择同意《时间银行》条款
				      </div>
				    </div>
				  </div>

				  <button class="btn btn-primary" type="submit" th:action="@{publish_detail}">确认发布</button>
				</form>
				
				<script>
				// Example starter JavaScript for disabling form submissions if there are invalid fields
				(function() {
				  'use strict';
				  window.addEventListener('load', function() {
				    // Fetch all the forms we want to apply custom Bootstrap validation styles to
				    var forms = document.getElementsByClassName('needs-validation');
				    // Loop over them and prevent submission
				    var validation = Array.prototype.filter.call(forms, function(form) {
				      form.addEventListener('submit', function(event) {
				        if (form.checkValidity() === false) {
				          event.preventDefault();
				          event.stopPropagation();
				        }
				        form.classList.add('was-validated');
				      }, false);
				    });
				  }, false);
				})();
				</script>

        </div>
       </div>
      </div>
        <!-- /.container-fluid -->

      </div>
      <!-- End of Main Content -->

      <!-- Footer -->
      <footer class="sticky-footer bg-white">
        <div class="container my-auto">
          <div class="copyright text-center my-auto">
            <span>Copyright &copy; Your Website 2020</span>
          </div>
        </div>
      </footer>
      <!-- End of Footer -->

    </div>
    <!-- End of Content Wrapper -->

  </div>
  <!-- End of Page Wrapper -->

  <!-- Scroll to Top Button-->
  <a class="scroll-to-top rounded" href="#page-top">
    <i class="fas fa-angle-up"></i>
  </a>

  <!-- Logout Modal-->
  <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
          <button class="close" type="button" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">×</span>
          </button>
        </div>
        <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
        <div class="modal-footer">
          <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
          <a class="btn btn-primary" href="login.html">Logout</a>
        </div>
      </div>
    </div>
  </div>

  <!-- Bootstrap core JavaScript-->
  <script src="vendor/jquery/jquery.min.js"></script>
  <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

  <!-- Core plugin JavaScript-->
  <script src="vendor/jquery-easing/jquery.easing.min.js"></script>
  <!-- Custom scripts for all pages-->
  <script src="js/sb-admin-2.min.js"></script>
  <script type="text/javascript" src="js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
  <script src="js/bootstrap-datetimepicker.zh-CN.js"></script>
  <script type="text/javascript">
      $('.form_datetime').datetimepicker({
          //language:  'fr',
          language: 'zh-CN',
          weekStart: 1,
          todayBtn:  1,
          autoclose: 1,
          todayHighlight: 1,
          startView: 2,
          forceParse: 0,
          showMeridian: 1
      });
      $('.form_date').datetimepicker({
          language: 'zh-CN',
          weekStart: 1,
          todayBtn:  1,
          autoclose: 1,
          todayHighlight: 1,
          startView: 2,
          minView: 2,
          forceParse: 0
      });
      $('.form_time').datetimepicker({
          language: 'zh-CN',
          weekStart: 1,
          todayBtn:  1,
          autoclose: 1,
          todayHighlight: 1,
          startView: 1,
          minView: 0,
          maxView: 1,
          forceParse: 0
      });
  </script>


</body>

</html>
